texture base_Tex;
sampler2D baseMap = sampler_state
{
   Texture = (base_Tex);
};
struct PS_INPUT 
{
   float2 Texcoord : TEXCOORD0;
   
};
float r, g, b, a;
float4 Pixel_Shader_ps_main( PS_INPUT Input ) : COLOR0
{
   float4 pre_value = tex2D( baseMap, Input.Texcoord );
   float4 past_value = float4(0.0f,0.0f,0.0f,0.0f);
   float brightness = r * pre_value.x + g * pre_value.y + b * pre_value.z;
   if (brightness < a)
      past_value.x = past_value.y = past_value.z = 0.0f;
   else
      past_value.x = past_value.y = past_value.z = 1.0f;
   return past_value;
}
technique Textured
{
   pass Pass_0
   {
      PixelShader = compile ps_2_0 Pixel_Shader_ps_main();
   }
}

